﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace XinGuanERP.Models.Po.system
{
    public class SysMenu : PrivateCommonEntity<string>, IEntityTypeBuilder<SysMenu>
    {
        public string? MenuType { get; set; }
        public string? MenuName { get; set; }
        public string? ParentId { get; set; }
        public string? RoutePath { get; set; }
        public string? Component { get; set; }
        public string? Permission { get; set; }
        public string? Icon { get; set; }
        public string? KeepAlive { get; set; }
        public string? LinkExternal { get; set; }
        public string? Visible { get; set; }
        public string? Frame { get; set; }
        public string? LinkUrl { get; set; }
        public int? Sort { get; set; }
        public string? Remarks { get; set; }
        public string? Status { get; set; }
        public void Configure(EntityTypeBuilder<SysMenu> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.ToTable("SYS_MENU");
            entityBuilder.HasKey(t => t.Id);
            entityBuilder.Property(t => t.Id).HasColumnName("ID");
            entityBuilder.Property(t => t.MenuType).HasColumnName("MENU_TYPE");
            entityBuilder.Property(t => t.MenuName).HasColumnName("MENU_NAME");
            entityBuilder.Property(t => t.ParentId).HasColumnName("PARENT_ID");
            entityBuilder.Property(t => t.RoutePath).HasColumnName("ROUTE_PATH");
            entityBuilder.Property(t => t.Component).HasColumnName("COMPONENT");
            entityBuilder.Property(t => t.Permission).HasColumnName("PERMISSION");
            entityBuilder.Property(t => t.Icon).HasColumnName("ICON");
            entityBuilder.Property(t => t.KeepAlive).HasColumnName("KEEPALIVE");
            entityBuilder.Property(t => t.LinkExternal).HasColumnName("LINK_EXTERNAL");
            entityBuilder.Property(t => t.Visible).HasColumnName("VISIBLE");
            entityBuilder.Property(t => t.Frame).HasColumnName("FRAME");
            entityBuilder.Property(t => t.LinkUrl).HasColumnName("LINK_URL");
            entityBuilder.Property(t => t.Sort).HasColumnName("SORT");
            entityBuilder.Property(t => t.Remarks).HasColumnName("REMARKS");
            entityBuilder.Property(t => t.Status).HasColumnName("STATUS");
            entityBuilder.Property(t => t.CreateUserId).HasColumnName("CREATEUSERID");
            entityBuilder.Property(t => t.CreateUserName).HasColumnName("CREATEUSERNAME");
            entityBuilder.Property(t => t.UpdateUserId).HasColumnName("UPDATEUSERID");
            entityBuilder.Property(t => t.UpdateUserName).HasColumnName("UPDATEUSERNAME");
            entityBuilder.Property(t => t.CreateTime).HasColumnName("CREATETIME");
            entityBuilder.Property(t => t.UpdateTime).HasColumnName("UPDATETIME");
        }
    }
}
